package com.hnguigu.ajax.service.impl;

import com.hnguigu.ajax.entity.City;
import com.hnguigu.ajax.entity.Country;
import com.hnguigu.ajax.mapper.CityMapper;
import com.hnguigu.ajax.mapper.CountryMapper;
import com.hnguigu.ajax.service.CountryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;


@Service
@Transactional
public class CountryServiceImpl implements CountryService {

    @Autowired
    private CountryMapper countryMapper;

    @Autowired
    private CityMapper cityMapper;

    @Override
    public List<Country> findAll() {
        return this.countryMapper.findAll();
    }

    @Override
    public List<City> findCityListById(Integer id) {
        return this.cityMapper.findCitysByCountryId(id);
    }
}
